<?php
	session_start();

	require 'lib/student_subjective_anwser.php';

	define('NUM_SUB_ITEM', 2);

	for($i = 1 ; $i < NUM_SUB_ITEM + 1; ++$i) {
		$itemno = 'subitem' . $i;
		$itemid = 'subitem' . $i . 'id';
		$ssa = new StudentSubAnwser;
		$ssa->sid = $_SESSION['sid'];
		$ssa->subitemid = $_POST["$itemid"];
		$ssa->text = $_POST["$itemno"];
		$_SESSION["$itemno"] = $ssa;	/* 此处或许传引用比较好 */
	}

	session_write_close();

	#var_dump($_SESSION);
	header("Location: done_exam.php");
?>
